import request from '@/utils/request';

// const baseUrl = 'https://alidev-kid.iqidao.com/api/teacher-admin/admin/teacher/game/review/list'

const baseUrl = '/app-admin'

// https://yapi.iqidao.com/project/103/interface/api/5972
// 7. 复盘列表- 根据查询条件查询复盘列表接口

export async function getReviewList(params?: any) {
  return request(baseUrl + '/teacher-admin/admin/teacher/game/review/list', {
    params,
  });
}

// https://yapi.iqidao.com/project/103/interface/api/6487
// 盘列表-发送状态数量接口

export async function listSendStatusCount (params?: any) {
  return request(baseUrl + '/teacher-admin/admin/teacher/game/review/listSendStatusCount',
  {
    params
  })
}

// https://yapi.iqidao.com/project/103/interface/api/6492
// 复盘列表-复盘状态数量接口

export async function listReviewStatusCount (params?: any) {
  return request(baseUrl + '/teacher-admin/admin/teacher/game/review/listReviewStatusCount',
  {
    params
  })
}

//https://yapi.iqidao.com/project/103/interface/api/6512
//  复盘列表-获取归属用户组列表

export async function getGroupList (params?: any) {
  return request(baseUrl + '/teacher-admin/admin/teacher/game/review/listBelongGroupByCourse',
  {
    params
  })
}

// https://yapi.iqidao.com/project/103/interface/api/6102


export async function saveThirdSgf(data?: any) {
  return request(baseUrl+ '/teacher-admin/admin/teacher/game/review/save/third/sgf',{
    method: 'POST',
    data
  })
}


export const startReview = (reviewId: any) => {
  return request(baseUrl + '/teacher-admin/admin/teacher/game/review/start', {
    method: 'POST',
    data:{
      reviewId
    }
  });
};

// https://yapi.iqidao.com/project/103/interface/api/6192
// 复盘列表-发送其他学员保存接口

export const sendOthers = (data: {
  sendType: number  //0 个人 1 指定班级 2 全班
  phones?: string,
  groupId?: number,
  id: number
  userId: number
}) => {
  return request(baseUrl + '/teacher-admin/admin/teacher/game/review/send/others', {
    method: 'POST',
    data
  });
};

// https://yapi.iqidao.com/project/103/interface/api/6572
// 发送其他学员-发送历史接口

export async function getlistSendOtherHistoryByPage (params?: any) {
  return request(baseUrl + '/teacher-admin/admin/teacher/game/review/listSendOtherHistoryByPage',
  {
    params
  })
}

// https://yapi.iqidao.com/project/103/interface/api/5932
// 教师复盘详情页-发送学员接口

export const sendStudent = (data: {
  reviewId: number
}) => {
  return request(baseUrl + '/teacher-admin/admin/teacher/game/review/send', {
    method: 'POST',
    data
  });
};

//  https://yapi.iqidao.com/project/103/interface/api/6082
//  复盘列表-删除复盘记录接口

export const delReview = (data: {
  reviewId: number
}) => {
  return request(baseUrl + '/teacher-admin/admin/teacher/game/review/delete', {
    method: 'POST',
    data
  });
};


// https://yapi.iqidao.com/project/103/interface/api/5957
// 复盘列表&详情页-重新录制接口

export const rewrite = (data: {
  reviewId: number
}) => {
  return request(baseUrl + '/teacher-admin/admin/teacher/game/review/rewrite', {
    method: 'POST',
    data
  });
};

// https://yapi.iqidao.com/project/103/interface/api/6562
// 复盘列表-更新复盘视频

export async function updateVideo (params?: any) {
  return request(baseUrl + '/teacher-admin/admin/teacher/game/review/updateVideo',
  {
    params
  })
}

// https://yapi.iqidao.com/project/103/interface/api/7217
// 复盘列表-将复盘中状态重置为待复盘接口
export async function resetVideo (data?: any) {
  return request(baseUrl + '/teacher-admin/admin/teacher/game/review/reset',
  {
    method: 'POST',
    data
  })
}

